/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

/* 游戏容器 */
.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 900px;
    width: 100%;
    margin: 20px;
}

/* 游戏头部 */
.game-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.game-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

/* 计分板 */
.score-board {
    display: flex;
    gap: 30px;
}

.player-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 10px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.player-name {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.score {
    font-size: 2rem;
    font-weight: bold;
    color: #ffd700;
}

/* 游戏控制按钮 */
.game-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
}

.btn-secondary {
    background: linear-gradient(45deg, #2196F3, #1976D2);
    color: white;
}

.btn-danger {
    background: linear-gradient(45deg, #f44336, #d32f2f);
    color: white;
}

/* 游戏主区域 */
.game-main {
    position: relative;
    background: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#gameCanvas {
    border: 3px solid #333;
    border-radius: 10px;
    background: #000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* 游戏覆盖层 */
.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.overlay-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.overlay-content h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 2rem;
}

.overlay-content p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.controls-info {
    text-align: left;
}

.controls-info h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.control-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.player-controls {
    background: rgba(102, 126, 234, 0.1);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.player-controls h4 {
    color: #667eea;
    margin-bottom: 8px;
    font-size: 1rem;
}

.player-controls p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* 游戏底部 */
.game-footer {
    background: #f8f9fa;
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
}

.game-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    color: #495057;
}

.stat span {
    color: #667eea;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-container {
        margin: 10px;
        border-radius: 15px;
    }

    .game-header h1 {
        font-size: 2rem;
    }

    .game-info {
        flex-direction: column;
        gap: 15px;
    }

    .score-board {
        gap: 20px;
    }

    .player-score {
        padding: 8px 15px;
    }

    .score {
        font-size: 1.5rem;
    }

    .btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    #gameCanvas {
        width: 100%;
        height: auto;
        max-width: 400px;
        max-height: 300px;
    }

    .overlay-content {
        padding: 20px;
        margin: 20px;
    }

    .control-group {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .game-stats {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .game-header h1 {
        font-size: 1.5rem;
    }

    .score-board {
        gap: 15px;
    }

    .player-score {
        padding: 6px 12px;
    }

    .score {
        font-size: 1.2rem;
    }

    .btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* 动画效果 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.btn:active {
    transform: scale(0.95);
}

.score {
    animation: pulse 0.3s ease-in-out;
}

/* 隐藏覆盖层 */
.game-overlay.hidden {
    display: none;
}

/* 游戏状态指示器 */
.game-status {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    z-index: 5;
}

/* 粒子效果 */
.particle {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}